default_platform(:ios)

platform :ios do
  
  desc "Run unit tests and check library"
  lane :test do
    carthage(platform: "iOS")
    scan(workspace: "AutoInsetter.xcworkspace", scheme: "AutoInsetter", clean: true)
    pod_lib_lint(verbose: true)
  end

  desc "Deploy a new version"
  lane :deploy do

    podspec = "AutoInsetter.podspec"
    version = version_get_podspec(path: podspec)

    # Push new Github release
    github_release = set_github_release(
      repository_name: "uias/AutoInsetter",
      api_token: ENV["GITHUB_TOKEN"],
      name: version,
      tag_name: version,
      description: "#{version} release.",
      commitish: "master"
    )

    # Push spec
    pod_push(allow_warnings: true)

  end

end
